package cn.good.yan.basics.t2.controller;


import cn.good.yan.basics.t2.mapper.BillMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 事务
 * @author yan
 * @date 2023/10/14
 */
@RestController
public class TransactionController {

    @Autowired
    BillMapper billMapper;

    /**
     * 事务管理
     * @return 列表
     */
    //指定隔离级别，传播方式
    @Transactional(isolation = Isolation.DEFAULT,propagation = Propagation.REQUIRED)
    @GetMapping("/tran")
    public String list(){
        return "succeed";
    }


}
